import { FC } from 'react';
import styles from './questionCard.module.scss';

type QuestionCardProps = {
  _id: string;
  title: string;
  isPublished: boolean;
  isStar: boolean;
  answer: number;
  createAt: string;
};

const QuestionCard: FC<QuestionCardProps> = (props) => {
  const { title, createAt, answer, isPublished, isStar } = props;
  return (
    <div className={styles.container}>
      <div className={styles.title}>
        <div className={styles.left}>
          <a href="#">{title}</a>
        </div>
        <div className={styles.right}>
          {isPublished ? (
            <span style={{ color: 'green' }}>已发布</span>
          ) : (
            <span>未发布</span>
          )}
          &nbsp;
          <span>{createAt}</span>
          &nbsp;
          <span>答卷: {answer}</span>
        </div>
      </div>

      <div className={styles['btn-container']}>
        <div className={styles.left}>
          <button>编辑问卷</button>
          <button>统计数据</button>
        </div>
        <div className={styles.right}>
          <button>标星</button>
          <button>复制</button>
          <button>删除</button>
        </div>
      </div>
    </div>
  );
};

export default QuestionCard;
